#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define ll long long
#define pi acos(-1)
const int maxn = 1e6+5;


int data[maxn];   //树状数组的数组
int n;   //星星数量 
int ans[maxn];   //答案数组 

inline int lowbit(int x)
{
	return x&(-x);
}

inline void update(int k,int x)
{
	for(int i=k;i<=maxn;i+=lowbit(i))
		data[i] += x;
}

inline int search(int l)
{
	int cnt = 0;
	for(int i=l;i;i-=lowbit(i))
		cnt += data[i];
	return cnt;
}

signed main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		int l,r;
		scanf("%d%d",&l,&r);
		++l;
		++ans[search(l)];
		update(l,1);
	}
	
	for(int i=0;i<n;++i) printf("%d\n",ans[i]);
	
	return 0;
}
